/*
 * Alexey Danchuk
 * This software is an implementation of the task from OOP module.
 */
package users;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import question.Question;

/**
 * This class describes student class.
 *
 * @version 1.01 20 February 2013
 * @author Alexey Danchuk
 */
public class Student extends User {
    
    Student(String name) {
        super(name);
    }

    private static int studentMark = 0;

    @Override
    protected void initializationTest(String fileNmae) throws IOException,
            Exception {
       System.out.println("Not permit. You are the student, not superuser");
    }

    @Override
    protected void initializationTest() throws IOException,
            Exception {
        System.out.println("Not permit. You are the student, not superuser");
    }

    @Override
    protected Question takeTheTest() {
        Question question;
        String answer = null;
        System.out.println("Enter a line of text (type 'quit' to exit): ");
        InputStreamReader inputStream = new InputStreamReader(System.in);
        BufferedReader bufferedStream = new BufferedReader(inputStream);
        do {
            try {
                answer = bufferedStream.readLine();
            } catch (IOException ex) {
                Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
            }
            question = super.takeTheTest();
            question.chekAnswer(answer);
        } while (question != null);
        return question;
    }
}
